A relational database is a database that stores information about data and how it is related in a flat two-dimensional table called a relation. For example, organizations often want to store and retrieve information about people, where they are located, and how to contact them. However, people often live or work at a variety of addresses, so recording and retrieving their addresses becomes important. Relational databases are ideal for supporting these kinds of applications. A Relational Database Management System (RDBMS) is software used to control reading, writing, modifying, and processing the information stored in the databases. The data are formally described and organized according to each database's relational model or database schema, according to the design.
A traditional relational database management system stores data in tables with the tables containing rows and columns of data. Certain columns are often designated as “key” columns, allowing rapid access to data via an index built based on the key. Certain types of key columns, such as dates and timestamps, lend themselves naturally to aggregation of data from a table containing a highly granular view for recent data, to a table containing a less granular view for older data. Software applications can use data manipulation instructions, such as the Structured Query Language (SQL), and built-in database functions such as triggers, to aggregate data through the implied hierarchy of tables from most granular to least granular.
Maintaining such a hierarchy has traditionally been accomplished by writing application code that uses application language constructs, or exploits database features such as “merge”. An RDBMS uses SQL MERGE, also known as upsert statements, to INSERT new records or UPDATE existing records depending on whether or not a condition matches. Another method is exploiting features of the database implementation that allow the hierarchy to be maintained automatically, e.g., by using “triggers”. A database trigger is procedural code that automatically executes in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information in the database. When a new record, representing a new teacher for example, is added to an employee table, new records should also be created in the tables for taxes, vacations and salaries.